package org.example.basic.day04;

public class Demo匿名内部类 {
    public static void main(String[] args) {
        Demo demo = new Demo();
       demo.method(new Person() {
           @Override
           public void eat() {
               System.out.println("吃吃吃");
           }
       });
    }
}

@FunctionalInterface
interface Person{
    void eat();
}


class Demo{
    public void method(Person person)
    {
        person.eat();
    }

}
